<%@ page language="java" contentType="text/html; charset=UTF-8"
   import="com.shopping.user.*" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
	User u = (User)session.getAttribute("User");
    if(u == null) {
    	out.println("You Haven't Logged In");
    	return;
    }

%>

<%
	request.setCharacterEncoding("UTF-8");
	String action = request.getParameter("action");
	if(action != null && action.equals("modify")) {
		String username = request.getParameter("username");
		//String password = request.getParameter("pwd");
		String phone = request.getParameter("phone");
		String addr = request.getParameter("addr");
		//User u = new User();
		u.setUsername(username);
		//u.setPassword(password);
		u.setAddr(addr);
		u.setPhone(phone);
		//u.setRdate(new java.util.Date(System.currentTimeMillis()));
		//u.save();
		u.Update();
%>
	<center>ModifyOK!</center>
	
<% 	

	}
	
	
%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>修改个人信息</title>
<script language=JavaScript src="javascript/regcheckdata3.js"></script>
</head>
<body>

<form name="form" method="post" action="usermodify.jsp" >
       <input type=hidden name="action" value="modify">
	  <table width="750" border="2" align="center">
	    <tr>
		  <td width="34" height="32">&nbsp;</td>
		  <td colspan="2" align="center" >修改个人信息</td>
		</tr>

		<tr>
		  <td>&nbsp;</td>
		  <td width="83"><div align="right">用户名:</div></td>
		  <td ><input type="text" name="username" size=30 value=<%=u.getUsername() %>></td>
		</tr>
		
		<!-- 
		<tr>
		  <td>&nbsp;</td>
		  <td><div align="right">密码:</div></td>
		  <td><input type="password" name="pwd" size="15" value=<%=u.getPassword() %>></td>
		</tr>
		
		
		<tr>
		  <td>&nbsp;</td>
		  <td><div align="right">确认密码:</div></td>
		  <td><input type="password" name="pwd2" size="15"></td>
		</tr>
		-->
		
		<tr>
		  <td>&nbsp;</td>
		  <td><div align="right">联系电话：</div></td>
		  <td><input type="text" name="phone" size="15" value=<%=u.getPhone() %>></td>
		</tr>
		
		<tr>
		  <td>&nbsp;</td>
		  <td><div align="right">联系地址：</div></td>
		  <td><textarea name="addr" cols="80" rows="12" value=<%=u.getAddr() %>></textarea> ></td>
		</tr>

		<tr>
		  <td>&nbsp;</td>
		  <td><input type="submit" value="提交" ></td>
		  <td><input type="reset"  value="重置"></td>
		</tr>
	  </table>
	</form>

</body>
</html>